<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
	<head>
		<title>首页</title>
		<meta charset=utf-8>
		<meta http-equiv="X-UA-Compatible" content="edge" />
		 <meta name="renderer" content="webkit"/>
		 <meta name="force-rendering" content="webkit"/>
		<%@include file="/WEB-INF/pcCommon.jspf"%> 
		<link href="/pc-static/css/rule.css" rel="stylesheet">
		<link rel="stylesheet" href="/css/swiper-4.1.6.min.css" />
		<script type="text/javascript"  src="/js/swiper-4.1.6.min.js"></script>	
		<style type="text/css">
			html, body {
		        position: relative;
		        height: 100%;
		        user-select: none;
		    }
		    body {
		      background: #eee;
		      font-family: Helvetica Neue, Helvetica, Arial, sans-serif;
		      font-size: 14px;
		      color:#000;
		      margin: 0;
		      padding: 0;
		    }
		    #pageData{
		    	background: #fff;
		    }
		    
		    .layui-layer-content{
		    	word-break: break-all;
			    line-height: 30px;
			}
		    
		    .layui-layer{
		    	border: 2px solid #059BF3;
    			border-radius: 12px;
		    }
		    
		    .layui-layer-title{
		    	font-size: 18px;
			    background: #059BF3;
			    color: #fff;
		    }
		    
		    .layui-layer-content {
		   		 font-size: 16px;
		    }
 
			.swiper-container {
		      width: 100%;
		      height: 100%;
		      margin-left: auto;
		      margin-right: auto;
		    }
		    .swiper-slide {
		      text-align: center;
		      font-size: 18px;
		      background: #fff;
		      display: -webkit-box;
		      display: -ms-flexbox;
		      display: -webkit-flex;
		      display: flex;
		      -webkit-box-pack: center;
		      -ms-flex-pack: center;
		      -webkit-justify-content: center;
		      justify-content: center;
		      -webkit-box-align: center;
		      -ms-flex-align: center;
		      -webkit-align-items: center;
		      align-items: center;
		    }
		    
		    .icon-Controller{
		    	background: url("/pc-static/img/tryplay.png");
		    }
		</style>
   </head>
<body>
	<!--[if lt IE 10]>
    <style type="text/css">
        html, body, p {
            margin: 0;
        }
        html, body {
            height: 100%;
            overflow: hidden;
            width: 100%;
        }
        .upgrade-browser {
            width: 540px;
            height: 220px;
            position: absolute;
            top: 50%;
            left: 50%;
            margin: -110px 0 0 -270px;
            z-index: 9999;

            background-color: #fff;
            border: 5px solid #999;
        }
        .upgrade-browser .inner {
            width: auto;
            padding: 15px;

            font: 18px/1.8 Tahoma, Geneva, sans-serif;
            text-align: center;
        }
        .upgrade-browser .face {
            display: block;

            font-size: 2.4em;
        }
        .upgrade-browser a {
            color: #f90;
            text-decoration: none;
        }
        .upgrade-browser a:hover {
            text-decoration: underline;
        }
        .upgrade-browser-background {
            width: 100%;
            height: 100%;
            position: absolute;
            top: 0;
            left: 0;
            z-index: 999;

            background-color: #000;
        }
    </style>
    <div class="upgrade-browser">
        <div class="inner">
            <p><span class="face">:(</span>请切换到极速模式或使用更高版本的IE浏览器</p>
            <p><a href="https://support.microsoft.com/zh-cn/help/17621/internet-explorer-downloads" target="_blank">请点击此处下载浏览器</a></p>
        </div>
    </div>
    <div class="upgrade-browser-background"></div>
<![endif]-->
<div id="loading" class="kd-loading" style="display:none">
	<div class="kd-spinner">
		<span class="bounce b1"></span>
		<span class="bounce b2"></span>
		<span class="bounce b3"></span>
	</div>
	<p>&nbsp;</p>
	<p>&nbsp;</p>
	<p>请稍等，努力加载中...</p>
</div>
<div class='wapper'>
	<!-- 头部 -->
	<div id='header'>
		<div class="tool_bar">
	        <div class="main">
	            <div class="left welcome"></div>
	            <div class="right top_bar_nav">
	                <ul>
	                  <li class="top_bar_nav color_switch" style="display: none;">
	                    <a target="_blank" id="color_switch" class="color_switch" style="display: none;">
	                      快速充值通道
	                    </a>
	                  </li>
	                  <li class="color_switch" style="display: none">|</li>
	                  <li class="top_bar_nav free_play">
	                    <a id="free_play">免费试玩</a>
	                  </li>
	                  <li>|</li>
	                  <li class="top_bar_nav speciaLogin" style="display: none;">
	                    <a class="speciaLogin" id="speciaLogin">特殊代理登录</a>
	                  </li>
	                  <li class="speciaLogin " style="display: none;">|</li>
	                  <li class="top_bar_nav">
	                    <a id="proxyReg" class="agency">加入代理</a>
	                  </li>
	
	                  <li>|</li>
	                  <li class="top_bar_nav ">
	                    <a class="AddFavorite" onclick="AddFavorite(window.location,document.title)" href="javascript:void(0)">加入收藏</a>
	                  </li>
	                  <li>|</li>
	                  <li class="top_bar_nav ">
	                    <a id="help" onclick="loadPage('/pc/help.do')">帮助中心</a>
	                  </li>
	                  <li>|</li>
	                  <li class="top_bar_nav ">
	                    <a id="playing" onclick="loadPage('/pc/rule.do')">玩法</a>
	                  </li>
	                </ul>
	            </div>
	        </div>
	    </div>
		<div class="special_agent_login_win">
	 		<div class="login_area">
	   			<div class="title">
	     			<span>特殊代理登录</span>
	    			 <i class="iconfont icon-guanbi " id="specialAgent"></i>
	  		 	</div>
		     	<div class="login_form">
		       		<div class="row">
		        	    <div class="left">
		          			<span>用户名</span>
		         		</div>
		         		<div class="right">
		          			 <input placeholder="请输入用户名" id="specialAgentName">
		         		</div>
		       	   	</div>
		       	   	<div class="row">
		         		<div class="left">
		           			<span>登录密码</span>
		         		</div>
		        		<div class="right">
		           			<input type="password" placeholder="请输入登录密码" id="specialAgentPwd">
		        		</div>
		       	  	</div>
		       	  	<div class="row">
		         		<div class="left">
		           			<span>验证码</span>
		         		</div>
		        		<div class="right">
		           			<input placeholder="请输入验证码" class="verify_code_input" id="specialAgentVerifyCode">
		           		<div class="verify_code" id="specialAgentVerifyCodeImg"></div>
		           			<span class="switch">换一张</span>
		        	  	</div>
		       	  	</div>
		     		<div class="login_btn">
		         	   <button id="specialAgentLoginBtn">立即登录</button>
		    		</div>
		        </div>
	 	   </div>
	   </div>
		<div class="header">
	 		 <div class="main">
	    		 <div class="left logo">
	      			 <a href="/pc/index.do" class="logo-link" target="_parent">
	        			<img width="227px" height="68px" alt="" src="">
	     			 </a>
	    		 </div>
	   		 	 <div class="right login_and_userinfo">
	   				 <div class='logined' style='display: none;'>
						  <em>您好，</em>
						  <span class='username' id='usernameShow'></span>
						  <em>会员等级：</em>
						  <span class='uservip' id='vip' style="color: red">VIP1</span>
						  <em>可用余额：</em>
						  <span class='money' id='moneyShow'></span>
						  <a onclick='window.location.reload()' id='refreshBalance'>刷新</a><i></i>
						  <a class='user_center' href='/pc/personal.do#userCenter'>用户中心</a><i class='isTry'></i>
						  <a class='red user_goto_recharge' href='/pc/personal.do#chooseGroup' style='display: none;color:red;' target='_parent'>充值</a>
						  <i class='isTry' style='initial'></i>
						  <a class='user_goto_withdraw' href='/pc/personal.do#withdraw' style='display: none;' target='_parent'>提现</a>
						  <i class='isTry' style='initial'></i>
						  <a href='/pc/personal.do#transactionRecord'>投注记录</a><i></i>
						  <a id='userLogout'>退出</a>
					</div>
					<div class='login' style='display: none;'>
						<div id='login_form'>
							<div class='username left'>
								<i class='iconfont icon-xingmingyonghumingnicheng'></i>
								<input type='text' placeholder='用户名' name='user_name' id='username'>
							</div>
							<div class='password left'>
								<i class='iconfont'>&#xe62d;</i>
								<input type='password' placeholder='密码' name='password' id='password' autocomplete='new-password'>
							</div>
							<div class='code left'>
								<input type='text' size='4' name='verify_code' placeholder='验证码' id='login_code_input' style='padding-left:74px;padding-right:10px;width:42px;'>
								<img class='code' id='YZcode' alt='点击刷新' title='点击刷新' style='position: absolute;left:5px;top:8.5px;display: none;line-height: 37px;' />
							</div>
							<button type='button' class='left btn-default login-btn btn' name='login' id='login_button1'>登录</button>
						</div>
						<button type='button' class='left d-btn reg-btn btn' name='register' id='register' onclick="loadPage('/pc/register.do')">注册</button>
					</div>
	   		 	</div>
	  		</div>
		</div>
		<div class="nav">
	  		<!--导航 Start-->
	  		<div class="menu">
	   			 <div class="nav">
	      			<ul class="clearfix" id="headNav" style="">
	        			<li><a onclick="loadPage('/pc/sy.do')" class="index active">首页</a></li>
				        <li>
				            <a onclick="loadPage('/pc/lotter.do')" class="gc" >购彩大厅</a>
				        </li>
				        <li class='dropdown'> 
				           <a >棋牌</a>
				           <ul class='chess'>
				          	<li id='bjl'>
				          		百家乐
				          	</li>
				          </ul>
				        </li>
				        <li class="tit">
					        <a onclick="loadPage('/pc/mobilegc.do')" class="mbgc">
					          	<i class="icon_nav_new"></i>手机购彩
					        </a>
				        </li>
				        <li class="tit">
				        	<a onclick="loadPage('/pc/activity.do')" style="position: relative;" class="activity">
				          		<i class="icon_nav_new" ></i>优惠活动
				           </a>
				        </li>
				        <li><a class="draw" onclick="loadPage('/pc/drawdetail.do')">开奖公告</a></li>
				        <li><a class="trend" onclick="loadPage('/pc/trendChart.do')">走势图表</a></li>
				        <li><a class="agency" target="_parent">加入代理</a></li>
				        <li><a class="rules" onclick="loadPage('/pc/rule.do')">玩法规则</a></li>
				        <li class="nav_qq"><a id="qq_service" class="qq_service"></a></li>
					 </ul>
		    	 </div>
		  	 </div>
		</div>
	</div>
	
	<!-- 页面数据 -->
	<div id='pageData'>
	</div>
	
	<!-- 底部内容 -->
	<div id='footer'>
		<div class="footer" style="margin-top: 0;">
			<div class="main footer-main">
				<div class="left footer-qr">
					<div class="footer-qr-head">
						<a href="" class="/">
							<img alt="" src="">
						</a>
					</div>
					<div class="footer-qr-img">
						<img width="120" height="120" alt="" src="">
					</div>
					<div class="footer-qr-foot">
						扫一扫添加微信客服
					</div>
				</div>
				<div class="right footer-nav">
					<div class="footer-nav-item left">
						<div class="nav_head">
							<i class="iconfont icon-remen icon-youshi"></i>
							<h2> 平台优势</h2>
						</div>
						<div class="nav_list nav_first">
							<ul class="nav_first_ul">
								<li><i class="iconfont">&#xe60b;</i>账户安全</li>
								<li><i class="iconfont">&#xe607;</i>购彩简单</li>
								<li><i style="padding-right: 0.4rem;" class="iconfont">&#xe608;</i>领奖方便</li>
								<li><i class="iconfont">&#xe672;</i>提款快速</li>
							</ul>
						</div>
					</div>
					<div class="footer-nav-item left">
						<div class="nav_head">
							<i class="iconfont">&#xe616;</i>
							<h2>账户相关</h2>
						</div>
						<div class="nav_list">
							<ul>
								<li>	
									<a class="goto" id="42">如何注册帐号</a>
								</li>
								<li>
									<a class="goto" id="44">怎么找回登录密码</a>
								</li>
								<li>
									<a class="goto" id="115">如何查看个人资料</a>
								</li>
								<li>
									<a class="goto" id="101">如何修改真实姓名</a>
								</li>
							</ul>
						</div>
					</div>
					<div class="footer-nav-item left">
						<div class="nav_head">
							<i class="iconfont">&#xe6c1;</i>
							<h2> 充值购彩</h2>
						</div>
						<div class="nav_list">
							<ul>
								<li>
									<a class="goto" id="47">如何进行充值</a>
								</li>
								<li>
									<a class="goto" id="85">如何购买彩票</a>
								</li>
								<li>
									<a class="goto" id="105">如何查询购彩记录</a>
								</li>
								<li>
									<a class="goto" id="61">在本站购彩安全吗</a>
								</li>
							</ul>
						</div>
					</div>
					<div class="footer-nav-item left">
						<div class="nav_head">
							<i class="iconfont tk">&#xe608;</i>
							<h2> 兑奖提款</h2>
						</div>
						<div class="nav_list">
							<ul>
								<li>
									<a class="goto" id="51">怎样进行兑奖</a>
								</li>
								<li>
									<a class="goto" id="53">如何进行提款</a>
								</li>
								<li>
									<a class="goto" id="54">提款是否收手续费</a>
								</li>
								<li>
									<a class="goto" id="57">提款不成功怎么办</a>
								</li>
							</ul>
						</div>
					</div>
				</div>
			</div>
		</div>
	
		<div class="footer_sec_icon">
			<ul>
				<li>
					<a href="#"><img width="120" height="45" src="" alt=""></a>
				</li>
				<li>
					<a href="#"><img width="120" height="45" src="" alt=""></a>
				</li>
				<li>
					<a href="#"><img width="120" height="45" src="" alt=""></a>
				</li>
				<li>
					<a href="#"><img width="120" height="45" src="" alt=""></a>
				</li>
				<li>
					<a href="#"><img width="120" height="45" src="" alt=""></a>
				</li>
			</ul>
		</div>
		<div class="footer_copyright">
			<p>2009-2018©彩票 公司版权所有 <br>彩票 郑重提示：彩票有风险，投注需谨慎。不向未满18周岁的青少年出售彩票！</p>
		</div>
	
		<div id="popupsMask" style="width: 100%;display: none"></div>
		<div class="verifys" style="display: none">
			<div class="verifyTitle">
				<span>温馨提示</span>
			</div>
			<div class="verifyText">
				<p>
					<span></span>
				</p>
			</div>
			<div class="verifyBtn">
				<span>确定</span>
				<span> 取消</span>
			</div>
		</div>
	
		<div class="dialog_con" style="display: none;">
			<div class="dialog">
				<div class="dialog_close"></div>
				<a target="_block" class="img"><img class="dialog_img"></a>
				<div class="text">
					<h2 class="title"></h2>
					<div class="content"></div>
					<button class="iKown">我知道了</button>
				</div>
			</div>
		</div>
	</div>
	
	<!-- 侧边栏 -->
	<div id="silidebar">
		<div class="zs_box zs_left" style="display: none;">
			<a class="zs_close" href="javascript:;">关闭</a>
			<li class="free_play">
				<a>
					<img src="/pc-static/img/tryplay.png" style='width:25px;'>
					<span id="free_plays">免费试玩</span>
				</a>
			</li>
			<li class="help_center">
				<a onclick="loadPage('/pc/help.do')">
					<img src="/pc-static/img/helps.png" style='width:20px;'>
					<span>帮助中心</span>
				</a>
			</li>
			<a class="qr"><img alt="" src=""></a>
			<span class="foot">
					        <em class="b">扫一扫</em>
					        <em class="s">安卓 APP下载</em>
					    </span>
			<a class="zs_top" href="javascript:;"> <i class="go_top"></i> 返回顶部</a>
		</div>
		<div class="zs_box zs_right" style="display: none;">
			<a class="zs_close" href="javascript:;">关闭</a>
			<li class="online_sup">
				<a id="i-online_service-icon-kefu" target="blank">
					<img src="/pc-static/img/kefu.png" style='width:20px;'>
					<span id="online_service">在线客服</span>
				</a>
			</li>
			<li class="line_exa">
				<a id="qq_service1" class="qq_service">
					<img src="/pc-static/img/qq.png" style='width:20px;'>
					<span>QQ客服</span>
				</a>
			</li>
			<a class="qr" href=""><img alt="" src=""></a>
			<span class="foot">
					            <em class="b">扫一扫</em><em class="s">苹果 APP下载</em>
					        </span>
			<a class="zs_top" href="javascript:;"> <i class="go_top"></i> 返回顶部</a>
		</div>
	</div>
	
	<!-- 试玩弹框 -->
	<div class="free_play_modal">
		<div class="inner">
			<input id="tryPlayAcount" type="text" value="" placeholder="请输入试玩用户名" class="form-control input-lg">
			<input id="tryPlayPwd" type="password" placeholder="请输入密码" class="form-control input-lg">
			<p>试玩账号只供玩家熟悉游戏。不允许充值和提款，且不享有参加优惠活动的权利，有效时间为<em>72小时。</em></p>
			<div class="btn-wrapper">
				<button id="free_play_no">暂不试玩</button>
				<button id="free_play_yes">立即试玩</button>
			</div>
		</div>
	</div>
</div>

<script>

function IEVersion() {
    var userAgent = navigator.userAgent; //取得浏览器的userAgent字符串  
    var isIE = userAgent.indexOf("compatible") > -1 && userAgent.indexOf("MSIE") > -1; //判断是否IE<11浏览器  
    var isEdge = userAgent.indexOf("Edge") > -1 && !isIE; //判断是否IE的Edge浏览器  
    var isIE11 = userAgent.indexOf('Trident') > -1 && userAgent.indexOf("rv:11.0") > -1;
    if(isIE) {
        var reIE = new RegExp("MSIE (\\d+\\.\\d+);");
        reIE.test(userAgent);
        var fIEVersion = parseFloat(RegExp["$1"]);
        if(fIEVersion == 7) {
            return 7;
        } else if(fIEVersion == 8) {
            return 8;
        } else if(fIEVersion == 9) {
            return 9;
        } else if(fIEVersion == 10) {
            return 10;
        } else {
            return 6;//IE版本<=7
        }   
    } else if(isEdge) {
        return 'edge';//edge
    } else if(isIE11) {
        return 11; //IE11  
    }else{
        return -1;//不是ie浏览器
    }
}
var version=IEVersion()
console.log(version)
if(version>=6 && version<=10){
	$(".zs_box").hide()
}else{
	$(".zs_box").show();
	/* 判断用户是否登录 */
	var loginState=0;  /* 0未登录 1用户登录 2试玩登录 */
	var pageState
	/* var pageState='/pc/sy.do'; */
	/* 记住这次地址的点击状态,下次如果一样就不执行 */
	var cname /* 彩种传递的参数 */
	var adress  /* 加载页面地址 */
	var type  /* 问答传递的参数 */
	var bjlFlag  /* 百家乐开启关闭开关,0是关闭,1是开启 */
	var state=true /* 是否加载公告弹窗,true为加载,false为不加载 */
	adress=localStorage.getItem("adress")
	if(adress==null){    /* 如果为null代表加载首页 */
		state=true
		adress=""
		pageState='/pc/sy.do'
		$('#pageData').load(pageState); 
	}else if(adress!=null){  /* 证明有跳转地址 */
		state=false
		cname=localStorage.getItem("cname")
		localStorage.removeItem("adress")
		localStorage.removeItem("cname")
		loadPage(adress) 
	}
	
	/* 展示公共数据(公告弹窗，图片和底部跳转等等) */
	$.ajax({
		url: "/explains/commonData.do",
		type: "post",
		data: {"type":4},
		success: function(data) {
			var newData=data.data
			if(state){
			 	if (data.data1.noticeName !=null && data.data1.noticeName !="" &&  data.data1.noticePicture !=null && data.data1.noticePicture !="" ) {
					 bindLayerControl(data.data1.noticeName,data.data1.noticePicture,"35%","50%") 
				 }
			} 
			notice=data.data1.notice
			$("#pc_notice").text(notice)
			$(".logo-link img").attr("src","/d/cp/"+data.data1.logo)
			$(".welcome").text(data.data1.pc_welcome)
			$(".footer-qr-head img").attr("src","/d/cp/"+data.data1.logo)
			$(".footer-qr-img img").attr("src","/d/cp/"+data.data1.pc_wechat) 
			var $goto=$(".goto")
			for(j=0;j<$goto.length;j++){
				for(i=0;i<newData.length;i++){
					var item=newData[i];
					if($goto.eq(j).attr("id")==item.id){
						$goto.eq(j).attr("data-id","0/"+i+"")
					}
				}
			}
			$("#help").on('click',function(){
				 type=""
			 })
			 
			 $(".help_center").on('click',function(){
				 type=""
			 })
			
			 /* 底部疑问跳转 */
			$(".goto").on("click",function(){
				type=$(this).attr("data-id")
				loadPage("/pc/help.do")
				if($('.help-box').length==1){
					bindTypeData("新手上路",type)
					$(".left-side").find("a:first").find(".nav-title").css("background-color","#e63a2f")
					$(".left-side").find("a:first").find(".nav-title").css("color","white") 
					$(".left-side").find("a:first").find(".icon-sub").css("display","inline-block") 
					$(".left-side").find("a:first").find(".icon-sub").css("color","white") 
					$(".left-side").find("a:first").find(".icon-tianjiaguize").css("display","none")
				    $(".left-side").find("a:first").siblings().find(".nav-title").css("background-color","transparent")
					$(".left-side").find("a:first").siblings().find(".nav-title").css("color","#333") 
					$(".left-side").find("a:first").siblings().find(".icon-sub").css("color","#e63a2f")
					$(".left-side").find("a:first").siblings().find(".icon-sub").css("display","none")
					$(".left-side").find("a:first").siblings().find(".icon-tianjiaguize").css("display","inline-block")
				}
			})
		}
	})
	/* 判断用户是否登录 */
	function userLogin(){
		$.ajax({
			url: "/users/pcUserWhetherLogin.do",
			type: "post",
			data: {},
			success: function(data) {
				if(data.data4==0){/* 玩家 */
					$(".agency").hide();
					$("#proxyReg").parent().next().hide();
					$(".menu .nav ul li a").css("width","6.6rem");
					$(".menu .nav ul li .chess").css("width","6.6rem");
				}else {
					$(".agency").show();
					$("#proxyReg").parent().next().show();
					$(".menu .nav ul li a").css("width","5.8rem");
					$(".menu .nav ul li .chess").css("width","5.8rem");
				}
				$("#qq_service").css("width","8rem");
				if(data.data!=0){
					$("#YZcode").attr('src','');
					$("#YZcode").hide();
					$('#usernameShow').text(data.data2);
					$('#vip').text(data.data3);
					$('#moneyShow').text(data.data1);
					$('.login').hide();
					$('.logined').show();
					if(data.data==1 || data.data==3){ /* 1用户登录  3内部账号 */
						console.log(333333333)
						loginState=1
						$(".isTry").css("display","inline-block")
						/* $(".isTry").eq(0).css("display","inline-block")
						$(".isTry").eq(1).css("display","inline-block") */
						$(".user_goto_recharge").css("display","inline")
						$(".user_goto_withdraw").css("display","inline")
						$(".user_center").css("display","inline")
						$(".uservip").prev().show();
					}else if(data.data==2){  /* 试玩登录 */
						loginState=2
						$(".uservip").prev().hide();
						$(".isTry").css("display","initial")
						/* $(".isTry").eq(0).css("display","initial")
						$(".isTry").eq(1).css("display","initial") */
						$(".user_goto_recharge").css("display","none")
						$(".user_goto_withdraw").css("display","none")
						$(".user_center").css("display","none")
					}
				}else{  /* 没有登录 */
					loginState=0
					$(".login").show()
					$(".logined").hide();
					$("#YZcode").attr('src','/u/code.do');
					$("#YZcode").show();
				}
			}
		})
	}
	userLogin()
	
	/* 点击刷新验证码 */
	$("#YZcode").on("click",function(){
		$(".code").attr("src","/u/code.do?"+Math.random());
	})

	/* 点击登录 */
	$('#login_button1').click('on',function(){
		var name = $('#username').val();
		var pass = $('#password').val();
		var code = $('#login_code_input').val();
		if(''==name){
			bindLayerLittle("提示：", '请输入账号')
			return false;
		}
		if(''==pass){
			bindLayerLittle("提示：", '请输入密码')
			return false;
		}
		if(''==code){
			bindLayerLittle("提示：", '请输入验证码')
			return false;
		}
		
		$.post('/u/login.do',{name:name,pass:pass,code:code},function(result){
			if(result.message==4){
				//登录成功
				bindLayerLittle("提示","登录成功")
				userLogin()
				/* setTimeout(function () {
				 	window.location.reload(); 
				}, 1000); */
			}else if(result.message==1){
				//验证码输入错误  请重新输入
				bindLayerLittle("提示：", "验证码输入错误请重新输入")
			}else if(result.message == 5){
				//账号或密码错误请重新输入
				bindLayerLittle("提示：", "账号或密码错误请重新输入")
			}else if(result.message == 0){
				//请重新刷新验证码
				bindLayerLittle("提示：", "请重新刷新验证码")
			}else if(result.message == 2){
				//账号已被禁用 请联系客服人员
				bindLayerLittle( "提示：", "账号已被禁用请联系客服人员")
			}else if(result.message == 3){
				//该ip被禁用，请更换ip重新登录
				bindLayerLittle( "提示：", "该ip被禁用请更换ip重新登录")
			}
		});
	});
	
	/* 退出 */
	$("#userLogout").on("click",function(){
		$.post('/pc/exit.do',{},function(result){
			loginState=0
			$(".login_and_userinfo input").val('');
			$(".login").show()
			$(".logined").hide();
			$("#YZcode").attr('src','/u/code.do');
			$("#YZcode").show();
		});
	});
	
	/* 免费试玩 */
	$('.free_play').on('click',function(){
		$.post('/u/tryPlayAcount.do',{},function(result){
			$('#tryPlayAcount').val(result.data);
		});
		$(".free_play_modal").show();
	})
	
	/* 关闭试玩弹窗 */
	$(".free_play_modal").on("click",".close",function(){
		$(".free_play_modal").hide()
	})
	
	/* 取消试玩 */
	$(".free_play_modal").on("click","#free_play_no",function(){
		$(".free_play_modal").hide()
	})
	
	/* 确定试玩 */
	$(".free_play_modal").on("click","#free_play_yes",function(){
		/* $(".free_play_modal").hide() */
		var acount = $('#tryPlayAcount').val();
		var pwd = $('#tryPlayPwd').val();
		$.post('/u/tryplay.do',{name:acount,pass:pwd},function(result){
			if(pwd==""){
				bindLayerLittle("提示：", "请输入试玩密码")
				return;
			}
			if(result.message == 10){
				//已经在登录状态啦
				bindLayerLittle("提示：", "你已经在登录状态！不可在登录")
				return;
			}
			if(result.message == 3){
				//已经在登录状态啦
				bindLayerLittle("提示：", "用户名已经存在,请手动更换用户名")
				return;
			}
			if(result.message == 2){
				//已经在登录状态啦
				bindLayerLittle("提示：", "你ip试玩次数过多，请明天在来吧")
				return;
			}
			$(".free_play_modal").hide()
			bindLayerLittle("提示","登录成功")
			userLogin()
		});
	})
	

		/* qq客服 */
		$(".qq_service").on("click",function(){
			$.post('/kfurl.do',{},function(result){
					window.location.href='tencent://message/?uin='+result.data[0].number+'amp;Site=web&amp;Menu=yes&#39'
				/* $('#qq_service1').attr('href',);
				$('#qq_service').attr('href','tencent://message/?uin='+result.data[0].number+'amp;Site=web&amp;Menu=yes&#39'); */
			});
		})
		
		/* 在线客服 */
		$("#i-online_service-icon-kefu").on("click",function(){
			if(loginState!=0){
				window.open("/pc/kefu.do")
			}else{
				bindLayerLittle("提示：", "登录以后可联系客服哦")		
			}
		})
		
		/* 加入代理 */
		$(".agency").on("click",function(){
			if(loginState==2){
				bindLayerLittle("提示：", '请先成为正式会员')
			}else if(loginState==0){
				bindLayerLittle("提示：", "请先登录")		
			}else if(loginState==1){
				window.location.href="/pc/personal.do#agentExplainNew";
			}
		})
		
		/* 百家乐 */
		$("#bjl").on("click",function(){
			if(loginState==0){
				bindLayerLittle("提示：", "请先登录")
			}else {
				if(bjlFlag==0){
					lotterDisable();
				}else{
					window.location.href="/pc/bjl.do";
				}
			}
		})
		var isClick=true;/* 防止点击过快 */
		/* 页面转换 */
			function loadPage(adress){
				if(adress=="/pc/register.do"){/* 注册页面的小bug调整 */
					if($(".register_forms").length==0){
						$("#pageData").empty();
						$('#pageData').load(adress);
					}
				}else if(adress=="/pc/help.do"){/* 帮助中心页面的小bug调整 */
					$("#pageData").empty();
					$('#pageData').load(adress);
				}else if(adress=="/pc/drawdetail.do"){ /* 开奖公告页面的小bug调整 */
					if($(".zoushi_data").css("display")=="none"){
						$("#pageData").empty();
						$('#pageData').load(adress);
					} 
				}
				if(pageState!=adress){
					pageState=adress;
		             $("#pageData").empty();
					$('#pageData').load(adress);    
		       } 
		}
 	 
	
	/* 加入收藏 */
	function AddFavorite(sURL, sTitle) {
	    sURL = encodeURI(sURL); 
		try{   
		    window.external.addFavorite(sURL, sTitle);   
		}catch(e) {   
		    try{   
		        window.sidebar.addPanel(sTitle, sURL, "");   
		    }catch (e) {   
		        alert("加入收藏失败，请使用Ctrl+D进行添加,或手动在浏览器里进行设置.");
		    }   
		}
	}
	
	 /*返回顶部 */
	$(".zs_top").click(function() {  
		return $("html").scrollTop() ? ($("html").animate({
			scrollTop: 0
		}, 800), !1) : ($("body").animate({
			scrollTop: 0
		}, 800), !1)
	});
	var isClick=true  /* 加把锁防止点击事件过快 */
	/* 导航栏切换 */
	$("#headNav li a").on("click",function(){
		
		if($(this).hasClass("qq_service") || $(this).parent().hasClass("dropdown")){
			return;
		}
			if($(this).hasClass("rules")){
				cname="2fssc"
			}else if($(this).hasClass("draw")){
				cname=""
			}else if($(this).hasClass("trend")){
				cname="2fssc"
			}else if($(this).hasClass("agency")){
				if(loginState!=1){
					return;
				}
			}
			$(this).addClass("active")
			$(this).parent().siblings().find("a").removeClass("active") 	
	})
	
	/* 点击玩法规则 */
	$("#playing").on("click",function(){
		cname="2fssc";
	})
	
	/* 点击注册 */
	$("#register").on("click",function(){
		$(".login input").val("");
	})
	
	$(".zs_close").on("click",function(){
		$(".zs_left").hide();
		$(".zs_right").hide();
	})
}

/* 点击投注时，是提示没有登录还是去登录页 */
function goLotterPage(cname){
	if(loginState==0){
		bindLayerLittle("提示：", "请先登录")
	}else{
		window.location.href="/pc/touzhu.do?cname="+cname;
	}
}
</script>
  
</body>
</html>
